From d239c0a68fb32716da8d2585cc2470ea4e8df3bd Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 20 Nov 2013 09:45:32 +0000 Subject: [PATCH] libxl: arm: ensure DTB is page aligned xc_dom_alloc_segment requires this. Since rambase and ramend are both page aligned, rounding up the DTB is sufficient. Reported-by: Julien Grall Signed-off-by: Ian Campbell Acked-by: Julien Grall --- tools/libxc/xc_dom_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index ffe575b4fd..a40e04ddfe 100644 --- a/tools/libxc/xc_dom_arm.c +++ b/tools/libxc/xc_dom_arm.c @@ -282,7 +282,7 @@ int arch_setup_meminit(struct xc_dom_image *dom) { const uint64_t rambase = dom->rambase_pfn << XC_PAGE_SHIFT; const uint64_t ramend = rambase + ( dom->total_pages << XC_PAGE_SHIFT ); - const uint64_t dtbsize = ( dom->devicetree_size + 3 ) & ~0x3; + const uint64_t dtbsize = ROUNDUP(dom->devicetree_size, XC_PAGE_SHIFT); /* Place at 128MB if there is sufficient RAM */ if ( ramend >= rambase + 128*1024*1024 + dtbsize ) -- 2.30.2